import 'package:json_annotation/json_annotation.dart';

part 'activity_item.g.dart';


@JsonSerializable()
class ActivityItem extends Object {

  @JsonKey(name: 'activityId')
  int activityId;

  @JsonKey(name: 'activityName')
  String activityName;

  @JsonKey(name: 'location')
  String location;

  @JsonKey(name: 'label')
  List<String> label;

  @JsonKey(name: 'totalParticipateNo')
  int totalParticipateNo;

  @JsonKey(name: 'price')
  String price;

  @JsonKey(name: 'activitySessionSample')
  List<ActivitySessionSample> activitySessionSample;

  @JsonKey(name: 'headPic')
  String headPic;

  ActivityItem(this.activityId,this.activityName,this.location,this.label,this.totalParticipateNo,this.price,this.activitySessionSample,this.headPic,);

  factory ActivityItem.fromJson(Map<String, dynamic> srcJson) => _$ActivityItemFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ActivityItemToJson(this);

}


@JsonSerializable()
class ActivitySessionSample extends Object {

  @JsonKey(name: 'time')
  String time;

  @JsonKey(name: 'participateNo')
  int participateNo;

  @JsonKey(name: 'activityCapacity')
  int activityCapacity;

  ActivitySessionSample(this.time,this.participateNo,this.activityCapacity,);

  factory ActivitySessionSample.fromJson(Map<String, dynamic> srcJson) => _$ActivitySessionSampleFromJson(srcJson);

  Map<String, dynamic> toJson() => _$ActivitySessionSampleToJson(this);

}
